//
//  ZYPurchase.m
//  ZYPurchase
//
//  Created by wu on 2020/8/6.
//  Copyright © 2020 wu. All rights reserved.
//

#import "ZYPurchase.h"

@implementation ZYPurchase

/// 唤醒支付系统
+ (void)wakeUp:(id <ZYPurchaseTransactionDelegate, ZYPurchaseOrderDelegate>)customer{
    [ZYPurchaseSaleman defaultSaleman].transaction_delegate = customer;
    [ZYPurchaseSaleman defaultSaleman].order_delegate = customer;
}

/// 清除代理
+ (void)clearCustomer{
    [ZYPurchaseSaleman defaultSaleman].transaction_delegate = nil;
    [ZYPurchaseSaleman defaultSaleman].order_delegate = nil;
}

/// 判断是否是订阅产品标识
+ (BOOL)isSubscribe:(nonnull NSString *)productIdentifier{
    return [ZYPurchaseSaleman isSubscribe:productIdentifier];
}

/// 添加或更新 log 记录
+ (void)resetLogRecorder{
    [ZYPurchaseSaleman resetLogRecorder];
}
/// 结束一次log记录
+ (BOOL)finishLogRecord{
    return [ZYPurchaseSaleman finishLogRecord];
}
/// 记录log
+ (void)logRecord:(id)content{
    [ZYPurchaseSaleman logRecord:content];
}

// 状态值转状态描述
+ (NSString *)transactionStatusDescription:(ZYPurchaseTransactionStatus)status{
    return [ZYPurchaseTransactionModel transactionStatusDescription:status];
}

@end
